<!--首页-->
<template>
	<div id="app">		
		<div id="center">
			<router-view/>
		</div>
		<app-nav></app-nav>
	</div>
</template>

<script>
	
	import Nav from './components/Nav.vue';
	import { Encrypt, objKeySort } from '../static/js/utils.js'; /*aes加密方法*/
	let Base64 = require('js-base64').Base64; /*base64加密方法*/
	export default {
		name: 'App',
		data() {
			return {
			}
		},
		components: {
			'app-nav': Nav/*路由组件*/
		},
		//在模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图
		created: function() {
                
	},
	methods: {
		
			GetUrlParam: function(name) { //截取浏览器窗口的url中指定的某个字段
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
				var r = window.location.search.substr(1).match(reg);
				console.log(r)
				if(r != null) return unescape(r[2]);
				return null;
			},
			
		},
		mounted() {
//			var msg = objKeySort("goods", "6")
//			console.log(msg)
//			let dateAes = Base64.encode(Encrypt(msg)); //Aes加密转base64
//			var url = '/pushhand/index.php?app=banner&mod=getBanner&huppy=pushhand';
//			this.$http({
//				method: 'get',
//				url: this.baseURL + url,
//				//           xhrFields:{ withCredentials: true},
//				headers: {}
//			}).then((res) => {
//				console.log(res)
//			}).catch((res) => {})
		}
	}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
	#app {
		font-family: "Microsoft YaHei", "微软雅黑", 'Avenir', Helvetica, Arial, sans-serif;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		color: #2c3e50;
		width: 100%;
		height: 100%;
	}
	
	#center {
	  width: 100%;
	  /* padding-bottom: 2rem; */
	  background: #F5F6FA;
	}
	
</style>